/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modele;

import java.lang.UnsupportedOperationException;

/**
 * @author Hadrien
 */

public class Mobilis extends Order {
    override public var description = bind "{quantity} Mobilis Ticket\nZone : {zone}";
    public var zone:String = "1 - 2" on replace {computePrice()};
    init {
        price = if (zone=="1 - 2") 6.10 else if (zone=="1 - 3") 8.20 else if (zone=="1 - 4") 10.15 else if (zone=="1 - 5") 13.65 else if (zone=="1 - 6") 17.30 else 0;
        name = "Mobilis";
    }

    override public function deliver () : Void {
        for (i in [1..quantity]) {
            println("Print a {name} for zone {zone}");
        }
    }

    function computePrice() {
        price = if (zone=="1 - 2") 6.10 else if (zone=="1 - 3") 8.20 else if (zone=="1 - 4") 10.15 else if (zone=="1 - 5") 13.65 else if (zone=="1 - 6") 17.30 else 0;
    }



}
